package pta.ch01.ex04;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String line = scanner.nextLine().trim();
            int sum = 0;
            for (char c : line.toCharArray()) {
                if (Character.isDigit(c)) {
                    sum += c - '0';
                }
            }
            System.out.println(sum);
        }
        scanner.close();
    }
}
